package com.restaurant.springboot.service.impl;

import com.restaurant.springboot.entity.PaymentEntity;
import com.restaurant.springboot.repositories.PaymentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author jack
 * @Date:2019/8/1 10:41
 */
@Service
public class PaymentServiceImpl {
    
    @Autowired
    PaymentRepository paymentRepository;

    public PaymentEntity getPaymentById(int id){
        return paymentRepository.findById(id).orElse(null);
    }

    public void addPayment(PaymentEntity paymentEntity) {
        paymentRepository.save(paymentEntity);
    }

    
}
